package core;

/**
 * The lexical analyzer reads the stream of characters making up
 * the source program and groups the characters into meaningful 
 * sequences  called lexemes. For each lexeme, the lexical analyzer
 * produces as output a token of the form that it passes on to the
 * subsequent phase, syntax analysis.
 * This class represents the output of the lexical analyzer.
 */
public class LexicalToken extends Token{

	/**
	 * The kind of token 
	 */
	private final Signal code;
	
	/** 
	 * Constructs a Lexical Token using the given token and code.
	 * @param token - the token.
	 * @param code - the signal of token.
	 */
	public LexicalToken( Token token, Signal code ) {
		super( token.getToken() );
		this.code = code;
	}

	/** 
	 * Constructs a Lexical Token using the given token and code.
	 * @param token - the string that represents a token.
	 * @param code - the signal of token.
	 */
	public LexicalToken( String token, Signal code) {
		super( token );
		this.code = code;
	}

	/**
	 * Returns the signal of lexical token.
	 * @return Signal - the signal of the lexical token 
	 */
	public final Signal getCode() {
		return code;
	}

}


